home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FLI106C.ZIP;1 / BLFROMTO.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  1.1 KB  |  72 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // BlazeClass
  8. //
  9.  
  10. #ifndef __BCPLUSPLUS__
  11. #pragma inline
  12. #endif
  13.  
  14. #include "fli.h"
  15.  
  16. #ifdef __BCPLUSPLUS__
  17. #pragma hdrstop
  18. #endif
  19.  
  20. #define I asm
  21.  
  22. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  23. //
  24. // CopyFromTo()
  25. //
  26. // Copy a text region from a virtual screen to another virtual screen
  27. //
  28. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  29.  
  30. void BlazeClass::CopyFromTo(int X,int Y,int Width,int Height,void far *FROM,
  31.   void far *TO)
  32. {
  33.   if (Width<1 || Height<1)
  34.     return;
  35.  
  36.   int ScreenWidth = BlazeClass::QuickWidth;
  37.  
  38.   I push ds
  39.  
  40.   I lds si,FROM
  41.   I les di,TO
  42.  
  43.   _DX = ((Y*ScreenWidth)+(X*2));
  44.   _SI += _DX;
  45.   _DI += _DX;
  46.  
  47.   I mov bx,[Width]
  48.   I mov dx,[Height]
  49.  
  50.   I cld
  51.  
  52. looped:
  53.  
  54.   I push si
  55.   I push di
  56.   I mov cx,bx
  57.  
  58.   I rep movsw
  59.  
  60.   I pop di
  61.   I pop si
  62.   I add si,ScreenWidth
  63.   I add di,ScreenWidth
  64.   I dec dx
  65.   I or dx,dx
  66.   I jne looped
  67.  
  68.   I pop ds
  69. }
  70.  
  71.  
  72.